functions which apply to tree structures. More...
#include "Tree.h"#include <stdlib.h>#include <stdio.h>#include <string.h>#include "Heap.h"
Defines | |
| #define | NO_HEAP_TRACKING 1 |
| #define | LEFT 0 |
| #define | RIGHT 1 |
Functions | |
| int | isRed (Node *aNode) |
| int | isBlack (Node *aNode) |
| void | TreeRotate (Tree *aTree, Node *curnode, int direction, int index) |
| Node * | TreeBAASub (Tree *aTree, Node *curnode, int which, int index) |
| void | TreeBalanceAfterAdd (Tree *aTree, Node *curnode, int index) |
| void * | TreeAddByIndex (Tree *aTree, void *content, size_t size, int index) |
| Add an item to a tree. | |
| Node * | TreeFindIndex1 (Tree *aTree, void *key, int index, int value) |
| Node * | TreeFindContentIndex (Tree *aTree, void *key, int index) |
| Node * | TreeMinimum (Node *curnode) |
| Node * | TreeSuccessor (Node *curnode) |
| Node * | TreeNextElementIndex (Tree *aTree, Node *curnode, int index) |
| Node * | TreeBARSub (Tree *aTree, Node *curnode, int which, int index) |
| void | TreeBalanceAfterRemove (Tree *aTree, Node *curnode, int index) |
| void * | TreeRemoveIndex (Tree *aTree, void *content, int index) |
| Remove an item from a tree. | |
| void | TreeInitializeNoMalloc (Tree *aTree, int(*compare)(void *, void *, int)) |
| Tree * | TreeInitialize (int(*compare)(void *, void *, int)) |
| Allocates and initializes a new tree structure. | |
| void | TreeAddIndex (Tree *aTree, int(*compare)(void *, void *, int)) |
| void | TreeFree (Tree *aTree) |
| void * | TreeAdd (Tree *aTree, void *content, size_t size) |
| Node * | TreeFindIndex (Tree *aTree, void *key, int index) |
| Node * | TreeFind (Tree *aTree, void *key) |
| Node * | TreeNextElement (Tree *aTree, Node *curnode) |
| void * | TreeRemoveNodeIndex (Tree *aTree, Node *curnode, int index) |
| Remove an item from a tree. | |
| void * | TreeRemove (Tree *aTree, void *content) |
| void * | TreeRemoveKeyIndex (Tree *aTree, void *key, int index) |
| void * | TreeRemoveKey (Tree *aTree, void *key) |
| int | TreeIntCompare (void *a, void *b, int content) |
| int | TreePtrCompare (void *a, void *b, int content) |
| int | TreeStringCompare (void *a, void *b, int content) |
functions which apply to tree structures.
These trees can hold data of any sort, pointed to by the content pointer of the Node structure.
| void * TreeAddByIndex | ( | Tree * | aTree, | |
| void * | content, | |||
| size_t | size, | |||
| int | index | |||
| ) |
Add an item to a tree.
| aTree | the list to which the item is to be added | |
| content | the list item content itself | |
| size | the size of the element |

| Tree* TreeInitialize | ( | int(*)(void *, void *, int) | compare | ) |
Allocates and initializes a new tree structure.

| void * TreeRemoveIndex | ( | Tree * | aTree, | |
| void * | content, | |||
| int | index | |||
| ) |
Remove an item from a tree.
| aTree | the list to which the item is to be added | |
| curnode | the list item content itself |

1.6.1